<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset='utf-8'" />
  <meta name="keywords" content="<%= @settings.keywords.to_s %>" />
  <title><%= @settings.title %>:&nbsp;<%= controller.action_name %></title>
  <link rel="alternate" type="application/rss+xml" href="media/rss" />
	  <%= theme_stylesheet_link_tag session[:loadedsettings]["theme"]+".css" %>
          <%= theme_stylesheet_link_tag 'niftyCorners.css' %>
	    <%= javascript_include_tag :defaults %>
	    <%= theme_javascript_include_tag "niftycube.js"%>
	    </head>
	    <body>
        <% content_for("page_scripts") do -%>
              NiftyLoad=function(){
			     Nifty("pre");
			     Nifty("div.module");
			     Nifty("div.comment_text");
			     Nifty("div.post_left");
		      }
	    <% end -%>
            <script type="text/javascript">
		<%= @content_for_page_scripts %>
	    </script>
	    <div id="topbar">
	    <% if session[:user]!=nil %>
	      <a onclick="Element.toggle('admin')"><%= theme_image_tag("book_key.png",:border =>0) %></a>&nbsp;
	      <% else %>
	        <%= link_to theme_image_tag("user_go.png",:border =>0),:controller =>"account",:action=>"login" %>&nbsp;
		<% end %>
		<a onclick="Element.toggle('extensions')"><%= theme_image_tag("page_white_put.png",:border =>0) %></a>
		</div>
		<div id='admin' style="display:none;">
		<%= render_component(:controller => 'admin/menu',:action =>'show') %>
		</div>
		<div id="extensions" style="display:none;">
		<% @exts=Extplugin.find(:all,:conditions=>{:activated=>1},:order=>"`extplugins`.`order` ASC") %>
		<% for item in @exts %>
		<%= render_component(:controller => 'plugin/'+item.name.to_s,:action =>'show') %>
		<% end %>
		</div>
		<div id="header">
		<p id="maintitle"><%= link_to h(@settings.title), :controller=>"media",:action=>"index" %></p>
		<p id="subtitle"><%=h @settings.subtitle %></p>
		</div>
		<div id='main'>
		<p style="color: red"><%= flash[:notice] %></p>
		<%= yield %>
		<br /><a onclick="new Effect.ScrollTo('topbar'); return false"><%= theme_image_tag("arrow_up.png",:border =>0) %></a>
		</div>
		<div id='footer'>
		<%= link_to image_tag("mandarina.png",:align=>"bottom",:border=>0,:title=>"mandarina blog code"),"http://code.google.com/p/mandarinablog/" %>&nbsp;<a href="/media/rss"><%= theme_image_tag("feed.png",:align=>"bottom",:border=>0) %></a>&nbsp;<a href="http://www.famfamfam.com/lab/icons/silk/"><%= theme_image_tag("images.png",:border =>0,:align=>"bottom",:alt=>"famfamfam silk icons") %></a>&nbsp;<a href="http://www.spreadfirefox.com"><img border="0" alt="Firefox 2" title="Firefox 2" src="http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/ff2b80x15.gif"/></a>
		<%= link_to image_tag("valid-xhtml10.png",:alt=>"Valid XHTML 1.0 Transitional",:height=>"16",:align=>"bottom"),"http://validator.w3.org/check?uri=referer" %>
		</div>
	</body>
</html>